//
//  HSAFNetworkManager.h
//  HSTS
//
//  Created by simon on 2017/1/24.
//  Copyright © 2017年 simon. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HSBasedResponseModel.h"
#pragma HTTPCALLBACK
typedef void(^HSObjectRequestSuccessWithFinishedBlock)(NSURLSessionDataTask *task,HSBasedResponseModel *basedResponse);


typedef void(^HSObjectRequestErrorWithFinishedBlock)(NSURLSessionDataTask *task, NSError *error);

typedef void(^HSObjectRequestFailedWithFinishedBlock)(NSURLSessionDataTask *task, NSError *error);
typedef void(^HSObjectCheckVersionSuccess)(BOOL isStop);

#pragma UPLOADCALLBACK
typedef void(^HSObjectUploadSuccessWithFinishedBlock)(HSBasedResponseModel *basedResponse);
typedef void(^HSObjectUploadErrorWithFinishedBlock)(NSError *error);
@interface HSAFNetworkManager : NSObject
+ (instancetype)sharedClient;

- (void)postPath:(NSString *)path
      parameters:(NSDictionary *)parameters
         success:(HSObjectRequestSuccessWithFinishedBlock)success
     serverError:(HSObjectRequestFailedWithFinishedBlock)serverFailure
    networkError:(HSObjectRequestFailedWithFinishedBlock)netFailure;

- (void)postPathWithoutSVProgressHud:(NSString *)path
                          parameters:(NSDictionary *)parameters
                             success:(HSObjectRequestSuccessWithFinishedBlock)success
                         serverError:(HSObjectRequestFailedWithFinishedBlock)serverFailure
                        networkError:(HSObjectRequestFailedWithFinishedBlock)netFailure;

-(void)uploadBinaryFile:(NSData*)data
               fileName:(NSString*)fileName
             parameters:(NSDictionary *)parameters
               mimeType:(NSString*)mimeType
                success:(HSObjectUploadSuccessWithFinishedBlock)success
                  error:(HSObjectUploadErrorWithFinishedBlock)failed;

-(BOOL)isAFNETRequesting;

@end
